package com.jinmei.service.impl;

import org.springframework.dao.DataAccessException;

import com.jinmei.dao.UserDao;
import com.jinmei.model.User;
import com.jinmei.service.UserService;

public class UserServiceImpl implements UserService {

	private UserDao userDao;
	
	@Override
	public User findUserByName(String name) throws DataAccessException {
		return userDao.findUserbyName(name.trim());
	}
	
	public void updatePwd(Integer userId, String newPassWord) throws DataAccessException {
		userDao.changePassWord(newPassWord, userId);
	}
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
}
